package com.cg.anno;

import com.cg.Validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import jakarta.validation.constraints.NotEmpty;

import java.lang.annotation.*;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Documented//元注解
@Target({ FIELD})//元注解
@Retention(RUNTIME)//元注解
@Constraint(validatedBy = {StateValidation.class})//提供校验规则的类
public @interface State {
       //提供校验失败后的提示信息
    String message() default "state参数的值只能是已发布或者草稿";
//指定分组
    Class<?>[] groups() default {};
  //分组 获取State注解的附加信息
    Class<? extends Payload>[] payload() default {};
}
